/***************************************************************************************************
  * @file:     xxx.c
  * @author:   guangjieMVP
  * @github:   https://github.com/guangjieMVP
  * @version:  v1.0.0
  * @date:     2020-xx-xx
  * @brief:               
*****************************************************************************************************/
#include "msg_driver_app.h"
#include "string.h"
#include "stdio.h"

msg_driver_t msg_driver = {0, 0, NULL};

static void msg1_handle(void *parm)
{
	printf("gets msg1\r\n");
}

static void msg2_handle(void *parm)
{
	printf("get msg2\r\n");
//	if (parm != NULL)
//	{
//		printf("%s\r\n", (char *)parm);
//	}
//	printf("\r\n");
}

static void msg3_handle(void *parm)
{
	printf("do msg3\r\n");
}

static void msg4_handle(void *parm)
{
	printf("I am four\r\n");
}


msg_node_t msg1 = {
	.parm = "I love u",
	.handler = msg1_handle
};

msg_node_t msg2 = {
	.parm = "I hate u",
	.handler = msg2_handle
};

msg_node_t msg3 = {
	.parm = NULL,
	.handler = msg3_handle
};

msg_node_t msg4 = {
	.parm = NULL,
	.handler = msg4_handle
};


void Msg_Test(void)
{
	msg_node_t *msg = NULL;
	
	publish_msg(&msg_driver, &msg1);
	publish_msg(&msg_driver, &msg2);
	publish_msg(&msg_driver, &msg3);
	publish_msg(&msg_driver, &msg3);
}





